/*----------------------------------------------------------------------
  File name: "RTC.h"

  Driver for DS1305 Real Time Clock.

  Wiring:
  [Mega32]  [RTC1305]
  Vcc          Vcc
  GND          GND
  SS=PB.4      CE  
  MOSI=PB.5    SI  
  MISO=PB.6    SO 
  SCK=PB.7     CLK

  Henning Hargaard, February 2, 2012
-----------------------------------------------------------------------*/


#define RTC_CONTROL_WRITE 0x8F
#define RTC_CONTROL_READ 0x0F
#define CLOCK_ADDR 4


typedef struct 
{
		unsigned char year;
		unsigned char month;
		unsigned char day;
		unsigned char hour;
		unsigned char minutes;
		unsigned char seconds;
}date_t;


void	Clock_Init();
void  Clock_SetDate(date_t date);
date_t	Clock_CreateDate(unsigned char year, unsigned char month, unsigned char day,
              unsigned char hour, unsigned char minutes, unsigned char seconds);	  
date_t	Clock_Date();
